#pragma once

#include "NateOnCryptStruct.h"

#define	BLOCKSIZE 64

enum CRYPT_MODE{eNormal = 0, eSEED = 1, eSHA256 = 2};

class CNateOnCrypt
{
public:
	CNateOnCrypt(void);
	virtual ~CNateOnCrypt(void);

public:
	void		SetCryptMode(CRYPT_MODE eMode){m_eMode = eMode;}
	CRYPT_MODE	GetCryptMode(){return m_eMode;}

public:
	void Char2Hex(unsigned char ch, char* szHex);
	BOOL Hex2Char(char const* szHex, unsigned char& rch);
	
	void Binary2Hex(unsigned char const* pucBinStr, int nBinSize, char* pszHexStr);
	BOOL Hex2Binary(char const* pszHexStr, unsigned char* pucBinStr, int nBinSize);
	
public:
	virtual	void	Reset() = 0;

	virtual	CStringA	Encrypt(CStringA strText){return "";}
	virtual	CStringA	Decrypt(CStringA strText){return "";}
	virtual	CStringA	Encrypt(CStringA strText, CStringA strKeyValue){return "";}
	virtual	CStringA	Decrypt(CStringA strText, CStringA strKeyValue){return "";}
protected:
	BOOL		m_bAddData;

private:
	CRYPT_MODE	m_eMode;
};
